<?php

try
{
    require_once("../config/conf.php");
    $dbFile = DemoConfig::$dbFile;
    $db = new SQLite3($dbFile); 
    
    $res = $db->query("select * from tbl_userinfo");
    show_db($res);
    $res = $db->query("select * from tbl_location");
    show_db($res);
    $res = $db->query("select * from tbl_userstatus");
    show_db($res);


}
catch (Exception $e)
{
    echo $e->getMessage() . PHP_EOL;
    return false;
}



    function show_db($res)
    { 
        while ($row = $res->fetchArray(SQLITE3_ASSOC))
        {
            foreach($row as $k => $v)
            {
                print "$k => $v".PHP_EOL;
            }
            print PHP_EOL;
        }
    }
